﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

using BUS;
using LinQ_DTO;
using System.Collections.Generic;

namespace TemplateH4.Admin
{
    public partial class QLTK_THEMTK : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        public void taoUser(aspnet_User u)
        {
            ApplicationsBUS abus = new ApplicationsBUS();
            List<aspnet_Application> list = abus.LayTatCaApplications();
            u.ApplicationId = list[0].ApplicationId;
            u.LastActivityDate = DateTime.Now;
            u.LoweredUserName = u.UserName;
            u.IsAnonymous = false;
            u.UserName = "abc";
            u.LoweredUserName = "abc";


        }


        public void taoMembership(aspnet_Membership u)
        {
            ApplicationsBUS abus = new ApplicationsBUS();
            List<aspnet_Application> list = abus.LayTatCaApplications();
            u.ApplicationId = list[0].ApplicationId;

            u.CreateDate= u.FailedPasswordAttemptWindowStart = u.FailedPasswordAnswerAttemptWindowStart = u.LastLockoutDate = u.LastLoginDate = u.LastPasswordChangedDate = DateTime.Now;
            u.DiemTichLuy = 0;
            u.IsApproved = false;
            u.IsLockedOut = false;
            u.FailedPasswordAnswerAttemptCount = u.FailedPasswordAttemptCount= 0;
            u.Password = u.PasswordSalt = "";
            u.PasswordFormat = 0;

        }
        protected void LinkButton1_Click(object sender, EventArgs e)
        {

        }

        protected void btnthem_Click(object sender, EventArgs e)

        {
            //String username = txtUsername.Text;
            //String email = txtEmail.Text;
            //String password = txtPassword.Text;
            //String dt = txtMobilePIN.Text;

            //UserBUS ubus = new UserBUS();
            //aspnet_User t = new aspnet_User();
            //taoUser(t);
            //t.UserId = System.Guid.NewGuid();
            //t.UserName = username;
            //t.MobileAlias = dt;


            //ubus.Them(t);
            //Guid id = t.UserId;

            //MembershipBUS mbus = new MembershipBUS();
            //aspnet_Membership m = new aspnet_Membership();
            //taoMembership(m);
            //m.Password = password;
            //m.CreateDate = DateTime.Now;
            //m.UserId = id;
            //m.Email = email;
            //m.MobilePIN = dt;
            //mbus.Them(m);

            //Response.Write("Them User thanh cong");



        }
    }
}
